/**
 * \file lib/system/syscall.c
 * \author Davide Gessa
 * \date 10-16-09
 */
#include "syscall.h"
#include <libc/ctype.h>
#include "regs.h"

/*
 * Call a generic syscall
 */
int syscall_call(regs_t reg)
{
	asm("movl %0, %%eax\n\t": : "g" (&reg));
	asm ("int %0\n" : : "g" (SYSCALL_INT));	
	asm ("movl %%eax, %0\n\t" : "=r" (reg.eax));
	
	return reg.eax;
}

